package com.groupbuying.settleproducer.utils;

import java.util.Random;
import java.util.UUID;

/**
 * 生成制定位数uuid工具类
 */
public class UuidUtils {

    public static String getUuid(int length){
        String str = UUID.randomUUID().toString().replaceAll("-","");
        Random random=new Random();
        StringBuffer sb=new StringBuffer();
        for(int i=0;i<length;i++){
            int number=random.nextInt(32);
            sb.append(str.charAt(number));
        }
        return sb.toString();
    }
}
